import java.util.Scanner;
class UsernameException extends RuntimeException
{
    public UsernameException()
    {
        super();
    }
    public UsernameException(String s)
    {
        super(s);
    }
}
class MimaException extends RuntimeException
{
    public MimaException()
    {
        super();
    }
    public MimaException(String s)
    {
        super(s);
    }
}


public class demo5 {
    private String username="129169";
    private String mima="1906";
    public  void login1(String username1,String mima1) {

        if(!(this.username.equals(username1)))
        {
            throw new UsernameException();
        }
        if(!(this.mima.equals(mima1)))
        {
            throw new MimaException();
        }
        System.out.println("登录成功");



    }

    public static void main(String[] args) {
        System.out.println("请输入您的用户名");
        Scanner scanner=new Scanner(System.in);
        String username1=scanner.nextLine();
        System.out.println("请输入您的密码");
        String mima1=scanner.nextLine();
        try{
            demo5 login=new demo5();
            login.login1(username1,mima1);
        }catch(UsernameException e){
            e.printStackTrace();
        }catch(MimaException e){
            e.printStackTrace();
        }finally {
            //login.close();
            System.out.println(1);

        }
        }








}
